<?php
/**
 * Created by PhpStorm.
 * User: RenBin
 * Date: 2015/9/8
 * Time: 14:59
 */

namespace common\models\Service;


use common\models\CommonFunction;
use common\models\CommonVar;
use common\models\LLpay\LLpayConfig;
use common\models\LLpay\LLpaySubmit;

class UnbundlingService {

    public static function deal($userID, $no_agree){
        $llpay_config = LLpayConfig::getConfig();
        $param = ["oid_partner" => trim($llpay_config['oid_partner']),
            "sign_type" => trim($llpay_config['sign_type'])];
        $param['user_id'] = CommonFunction::encrypt('scyd'.$userID, CommonVar::$encrypt);
        $param['no_agree'] = CommonFunction::decrypt($no_agree);
        $param['pay_type'] = 'D';
        $llpay = new LLpaySubmit($llpay_config);
        $result = $llpay->buildRequestPara($param);
        return CommonFunction::http_post('https://yintong.com.cn/traderapi/bankcardunbind.htm', json_encode($result));

    }
}